package server

import (
	"context"
	"gitee.com/kmyss/gf-ex/yscmd"
)

type Builder struct {
	yscmd.CommandBuilderCore
}

func (b *Builder) Init(ctx context.Context) {
	b.CommandBuilderCore.Init(ctx)
	b.C.Use = "server"
	b.C.Short = "启动常用的 http 服务..."
	b.C.Long = `
    可以启动多个常用的 http 服务
	- 静态文件代理
	- YS-MQ WebSocket （用于前端通过 YS-MQ 进行数据通讯）`
	b.C.Example = `
	`
	b.C.Note = `
    `

	b.C.Run = run
	b.addFlag()
}

func (b *Builder) addFlag() {
	b.SetFlag(&yscmd.FlagDebugBuilder{})
}

func run(c *yscmd.Command) {
	// TODO 增加
}

func Server(ctx context.Context) *yscmd.Command {
	c := &Builder{}
	c.Init(ctx)
	return c.Command()
}
